﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;


namespace PuzzleCoop
{
    public class Den : GameObject
    {
        int spawnInterval = 5000;
        double timer = 0;

        public Den(PlayScreen playScreen, Vector2 pos)
            : base(playScreen, GameScreenManager.Load<Texture2D>("Images\\Board\\PE\\iconPA"))
        {
            position = pos;
        }

        public override void Update(GameTime gameTime)
        {
            timer += gameTime.ElapsedGameTime.TotalMilliseconds;
            if (timer > spawnInterval)
            {
                timer -= spawnInterval;
                playScreen.gameObjects.Add(new Enemy(playScreen, position));
            }
            direction.Normalize(); // rotation = (float)Math.Atan2(direction.Y, direction.X); // não precisa desta linha pq o rotation é calculado a partir do direction
        }

    }
}
